package com.taotao.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.taotao.pojo.TbItem;
import com.taotao.service.ItemService;

import pojo.EasyUIDataGridResult;
import pojo.TaotaoResult;
@Controller
public class ItemController {
	@Autowired
	private ItemService itemService;
	
	@RequestMapping("/item/list")
	@ResponseBody
	public EasyUIDataGridResult getItemList(Integer page,Integer rows) {
		EasyUIDataGridResult easyUIDataGridResult = itemService.getItemList(page, rows);
		return easyUIDataGridResult;
	}
	

	//新增商品保存
	@RequestMapping("/item/save")
	@ResponseBody	
	public TaotaoResult saveItem(TbItem item, String desc) {
		TaotaoResult result = itemService.addItem(item, desc);
		return result;
	}
}
